<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>回调函数</title>
</head>

<body>
    <input type="text" name="input" id="input" oninput="syncTextBox()" /><br />
    <input type="text" name="output" id="output" />
    <script type="text/javascript">
        function syncTextBox() {
            var obj1 = document.getElementById("input");
            var obj2 = document.getElementById("output");
            obj2.value = obj1.value;
        }
    </script>
</body>

</html>